////////////////////////////////////////////////////////////////////////////////////////
//
// JSimpleSim - A machine language simulator based on SimpSim by Anne-Gert Bultena.
//
// Copyright (C) 2008 Gerardo Camorlinga, Ryan Fitzgerald, and RJ Gordon
//
// This file is part of JSimpleSim.
//
// JSimpleSim is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// JSimpleSim is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JSimpleSim.  If not, see <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////////////

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jsimplesim.view.renderers;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;

/**
 *
 * @author f08maroon
 */
@SuppressWarnings("serial")
public class HexCellRenderer extends DefaultTableCellRenderer {

    private static final Color hexBackground = Color.white;
    @SuppressWarnings("unused")
	private static int lastRowEdited;
    @SuppressWarnings("unused")
	private static int lastColEdited;

    /**
     *
     */
    public HexCellRenderer() {
        lastRowEdited = -1;
        lastColEdited = -1;
    }

    /**
     *
     * @param row
     * @param col
     */
    public HexCellRenderer(int row, int col) {
        lastRowEdited = row;
        lastColEdited = col;
    }

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected,
            boolean hasFocus,
            int row,
            int column) {

        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        setBackground(hexBackground);
        setHorizontalAlignment(CENTER);

        return this;
    }
}

